<?php
class Events_model extends CI_Model {
    public function __construct() {
        $this->load->database();
    }
    
    public function set_events($datos) {
        $this->db->insert('events', $datos);
    }
    
    public function get_events($idioma) {
        $query = $this->db->query("SELECT *
                                    FROM
                                        events
                                    WHERE
                                        idioma = '$idioma'
                                    ORDER BY
                                        fecha DESC");
        return $query->result_array();
    }
    
    public function delete_events($idevents) {
        $this->db->delete('events', array('idevents' => $idevents));
    }
}
?>
